Door and window sensors that operates using a magnetic switch (e.g., Reed switch) are subject to tampering. For example, a rogue magnet can be used to bypass the sensor and trick the magnetic switch that the door or window is still closed.